package com.skyhub.exception;

import com.skyhub.common.domain.pojo.Result;
import com.skyhub.common.exception.EmailLoginIllegalException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@Slf4j
@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(EmailLoginIllegalException.class)
    public Result error(EmailLoginIllegalException e){
        log.error(e.getMessage());
        return Result.error("邮箱验证错误",e.getMessage() );
    }

}